#ifndef __RED_BOUND_METHOD_OBJECT_H__
#define __RED_BOUND_METHOD_OBJECT_H__

#include "redobject.h"

typedef struct _RedBoundMethodObject
{
	RedObject_HEAD

	RedObject		*bm_self;
	RedObject		*bm_callable;
} RedBoundMethodObject;

RED_EXPORT extern RedTypeObject RedType_BoundMethod;

#define RedBoundMethod_Exact(o)			((o)->ob_type == &RedType_BoundMethod)

#define RedBoundMethod_Self(o)			(((RedBoundMethodObject *)(o))->bm_self)
#define RedBoundMethod_Callable(o)		(((RedBoundMethodObject *)(o))->bm_callable)

RED_EXPORT RedObject *RedBoundMethod_Invoke(RedObject *self, RedObject *args);
RED_EXPORT RedObject *RedBoundMethod_BindSelf(RedObject *callable, RedObject *self);

#endif /* __RED_BOUND_METHOD_OBJECT_H__ */
